<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0" />
    <link rel="icon" href="<%= BASE_URL %>favicon.ico" />
    <title><%= htmlWebpackPlugin.options.title %></title>
    <script>
      var width =
        document.documentElement.clientWidth || document.body.clientWidth
      if (width >= 1200) {
        let fontsize = (width / 1920) * 40 //fontsize为当前屏幕的基数字体，相对于设计稿计算得到的。
        document.getElementsByTagName('html')[0].style['font-size'] =
          fontsize + 'px'
      }
      window.onresize = () => {
        //当页面尺寸改变的时候生效
        return () => {
          let width =
            document.documentElement.clientWidth || document.body.clientWidth
          if (width >= 1200) {
            let fontsize = (width / 1920) * 40
            document.getElementsByTagName('html')[0].style['font-size'] =
              fontsize + 'px'
          }
        }
      }
    </script>
  </head>

  <body>
    <noscript>
      <strong
        >We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work
        properly without JavaScript enabled. Please enable it to
        continue.</strong
      >
    </noscript>
    <div id="app"></div>
    <!-- built files will be auto injected -->
  </body>
</html>
